import axios from '../utils/axios';
const baseURL = '/api/article/';

//添加文章
export const addArticleApi = async (params: object) => {
  return axios.post(`${baseURL}addArticle`, params);
}

//更新修改文章
export const updateArticleApi = async (params: object) => {
  return axios.post(`${baseURL}updateArticle`, params);
}

//获取文章
export const getArticleApi = async (params: object) => {
  return axios.post(`${baseURL}getArticle`, params);
}

//获取已发布和未发布的状态数
export const getArticleStateApi = async (params: object) => {
  return axios.post(`${baseURL}getArticleStateCount`, params);
}

//修改文章状态（发布与撤销）
export const updateArticleStateApi = async (params: object) => {
  return axios.post(`${baseURL}updateArticleState`, params);
}

//删除文章
export const deleteArticleApi = async (params: object) => {
  return axios.post(`${baseURL}deleteArticle`, params);
}

//获取文章详情
export const getArticleByIdApi = async (params: object) => {
  return axios.post(`${baseURL}getArticleById`, params);
}